import java.util.Arrays;
/*public void rotate(int[] nums, int k) {

        }*/
public class Text {
    public static  void rotate1(int left,int right,int[]nums){
        int l=left;
        int r=right;
        while(l<=r){
            int tmp=nums[l];
            nums[l]=nums[r];
            nums[r]=tmp;
        }
    }
    public static void main(String[] args) {
        int k=2;
        int[]arr={1,2,3,4};
        k%=arr.length;
        rotate1(0,arr.length-1,arr);
        rotate1(0,k,arr);
        rotate1(k, arr.length-1, arr);0
        System.out.println(Arrays.toString(arr));
        System.out.println(1);
    }
    public static void main1(String[] args) {
        int []arr={0,1,2,4,3,6};
        Arrays.sort(arr);
        for (int i = 0; i <arr.length; i++) {
            if (arr[i] != i) {
                System.out.println(i);
            }
        }
        System.out.println(arr.length);
    }
}
